#ifndef SOUNDMANAGER_H_INCLUDED
#define SOUNDMANAGER_H_INCLUDED

#include "Singleton.h"
#include "GameObject.h"
#include <string>
#include <map>
#include <SDL_mixer.h>

class File;

class SoundManager : public Uncopyable
{
	typedef std::map<int, Mix_Chunk*> SEffects;
	typedef std::map<int, Mix_Music*> MusicTracks;

private:
	SoundManager();
	friend class Singleton<SoundManager>;
public:
	bool SoundEffectPlay(int effectId);
	bool MusicPlay(int musicId, bool loop);
	
	bool Load(const std::string& effectPathList, const std::string& musicPathList);
	bool LoadSoundEffect(File* const f);
	bool LoadMusic(File* const f);
	void EnableEffects();
	void Mute();
	void UnMute();
private:
	
	SEffects m_soundEffects;
	MusicTracks m_musicTracks;
	SEffects::iterator m_it;
	MusicTracks::iterator m_jt;

	bool m_isMuted;
	bool m_panningEnabled;
};

typedef Singleton<SoundManager> TheSoundManager;

#endif